#pragma once

#include "NeroCore\NRtti.h"
#include "NeroCore\NSerializable.h"

namespace Engine
{
	class NEntity;
}

namespace Game
{
class NComponent : public Core::NSerializable
{
protected:
	typedef std::pair<std::string, std::string> ComponentInfo;
private:
	RTTI_DECLARATIONS(NComponent, Core::NSerializable)
public:
	NComponent(void);

	virtual ~NComponent(void);

	virtual void Initialize(Engine::NEntity* owner) = 0;

	virtual void Deinitialize() = 0;

	virtual void Update(float deltaTime) = 0;

	virtual void SetData(ComponentInfo data) = 0;
	
	void Enable();
	
	void Disable();

protected:
	unsigned int mHandle;
	bool mIsEnabled;
	Engine::NEntity* mOwner;
};
}